import MyLocalStorage from "./MyLocalStorage";
import MyLocalStorage2 from "./MyLocalStorage2";
// import newTotal from './Test2'; // 这里导入 newTotal 是0

// let myLocalStorage = new MyLocalStorage();
let myLocalStorage = MyLocalStorage.getInstance();
// myLocalStorage.setItem("loginUser", { username: "lisi", age: 23 });

// 如果这样零散的导出对象不利于维护
export default myLocalStorage;

console.log("MyLocalStorage2.getTotal()1：", MyLocalStorage2.getTotal()); // 0
MyLocalStorage2.addTotal();
console.log("MyLocalStorage2.getTotal()2：", MyLocalStorage2.getTotal()); // 3
MyLocalStorage2.addTotal();
console.log("MyLocalStorage2.getTotal()3：", MyLocalStorage2.getTotal()); // 6

import newTotal from './Test2'; // 这里导入 newTotal 是6
console.log('newTotal', newTotal);

